/*
 * Created by SharpDevelop.
 * User: Administrator
 * Date: 24-04-2009
 * Time: 11:55
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace Plain
{
	/// <summary>
	/// Description of EnumExtensions.
	/// </summary>
	public static class EnumExtensions{
		public static bool IsOneOf(this Enum e,params Enum[] enums){
			if(e!=null && enums!= null){
				foreach(Enum e2 in enums){
					if(e.Equals(e2)){
						return true;
					}
				}
				return false;
			}else{
				return false;
			}
		}
		public static bool IsPartOf(this Enum e, Enum e2){
			
			if(e!=null && e2!=null && (e.GetHashCode() & e2.GetHashCode())== e.GetHashCode()){
				return true;
			}else{
				return false;
			}
		}
	}
}
